home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Source Code
/
Visual Basic Source Code.iso
/
vbsource
/
tab
/
tab.frm
< prev
next >
Wrap
Text File
|
1993-11-24
|
6KB
|
198 lines
VERSION 2.00
Begin Form Form1
AutoRedraw = -1 'True
BackColor = &H00C0C0C0&
BorderStyle = 1 'Fixed Single
Caption = "Tabbed Dialog Box Example"
ClientHeight = 5115
ClientLeft = 1995
ClientTop = 2130
ClientWidth = 7800
ClipControls = 0 'False
Height = 5520
Left = 1935
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 341
ScaleMode = 3 'Pixel
ScaleWidth = 520
Top = 1785
Width = 7920
Begin Frame Frame1
BackColor = &H00C0C0C0&
Caption = "Option 4"
ClipControls = 0 'False
Height = 2415
Index = 3
Left = 3930
TabIndex = 4
Top = 2520
Width = 3735
Begin Label Label2
Alignment = 2 'Center
BackStyle = 0 'Transparent
Caption = "Even more stuff here"
Height = 465
Index = 3
Left = 600
TabIndex = 0
Top = 630
Width = 2115
End
End
Begin Frame Frame1
BackColor = &H00C0C0C0&
Caption = "Option 3"
ClipControls = 0 'False
Height = 2415
Index = 2
Left = 120
TabIndex = 3
Top = 2520
Width = 3735
Begin Label Label2
Alignment = 2 'Center
BackStyle = 0 'Transparent
Caption = "Third set of controls here"
Height = 465
Index = 1
Left = 630
TabIndex = 7
Top = 840
Width = 2115
End
End
Begin Frame Frame1
BackColor = &H00C0C0C0&
Caption = "Option 2"
ClipControls = 0 'False
Height = 2415
Index = 1
Left = 3930
TabIndex = 2
Top = 90
Width = 3735
Begin Label Label2
Alignment = 2 'Center
BackStyle = 0 'Transparent
Caption = "By the way this routine was designed from a screen shot of Word 6 in a magazine!"
ForeColor = &H00FF0000&
Height = 705
Index = 4
Left = 360
TabIndex = 9
Top = 1410
Width = 3045
End
Begin Label Label2
Alignment = 2 'Center
BackStyle = 0 'Transparent
Caption = "Second set of controls here"
Height = 465
Index = 0
Left = 660
TabIndex = 6
Top = 750
Width = 2115
End
End
Begin Frame Frame1
BackColor = &H00C0C0C0&
Caption = "Option 1"
ClipControls = 0 'False
Height = 2415
Index = 0
Left = 120
TabIndex = 1
Top = 90
Width = 3735
Begin Label Label2
Alignment = 2 'Center
BackStyle = 0 'Transparent
Caption = "Hope this gives you some ideas on how to implement tabbed dialog boxes - Enjoy - Richard Eke"
ForeColor = &H00FF0000&
Height = 705
Index = 2
Left = 270
TabIndex = 8
Top = 1320
Width = 3045
End
Begin Label Label1
Alignment = 2 'Center
BackStyle = 0 'Transparent
Caption = "Some controls and stuff here"
Height = 465
Left = 690
TabIndex = 5
Top = 750
Width = 2115
End
End
End
Option Explicit
Dim Shared TabItems() As String
Sub Form_Load ()
Dim c As Integer
Width = 4000
Height = 3200
Move Screen.Width / 2 - Width / 2, Screen.Height / 2 - Height / 2
'*** Set-up tabs to display
ReDim TabItems(4)
TabItems(1) = "Option 1"
TabItems(2) = "Option 2"
TabItems(3) = "Option 3"
TabItems(4) = "Option 4"
'*** Display the tabs - the code that responds to them
'*** is on Form_MouseUp
TabDialog Me, TabItems(), 1, 0, 0
'*** Put the frames on top of each other
For c = 0 To 3
Frame1(c).Move 8, 24
Next c
'*** Make the first one on top
Frame1(0).ZOrder 0
'********************************************************
' The Sub program TileDialog is only a beginning
' This routine could do with a lot of improvement
' and made more flexible.
' As it stands it only works properly with
' Form.Autoredraw = True
' and borderwidth set to Fixed single
' If the form needed to be sizeable it would have to
' redraw on the paint event (remembering which 'tab'
' is active
' I hope this simple routine is of some use to
' someone!
' Richard Eke
' 100031,233
'********************************************************
End Sub
Sub Form_MouseUp (Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim ActiveTab As Integer
TabDialog Me, TabItems(), ActiveTab, X, Y
Select Case ActiveTab
Case 0 'Do nothing
Case 1, 2, 3, 4
Frame1(ActiveTab - 1).ZOrder 0
End Select
End Sub